Dynamically loadable kernel modules (“DLKM's”). DLKM's are executable modules which may be loaded into and unloaded from kernel memory dynamically, without requiring the executing computer to be rebooted. Architectures supporting DLKM's often employ a registration service to manage memory for the supported DLKM's.
Under a typical registration service, invoking a “service-begin” routine in a particular DLKM by calling the device switch table open( ) routine increments a “hold count” associated with the DLKM, and when a “service-end” routine is invoked in the DLKM by calling the device switch table close( ) routine, the associated “hold count” is decremented. As long as the hold count remains positive, the DLKM is considered to be providing a service and should remain resident in memory. When the hold count reaches zero, indicating that there are no longer any calls being serviced, the DLKM may be unloaded from memory.
Under a typical registration service, a “depend count” is associated with a particular DLKM whenever other DLKMs loaded on the system require services provided by the particular DLKM. A DLKM may not be unloaded from memory if its depend count is greater than zero.
In prior environments, only certain types of modules (e.g. DLKM's) may take advantage of the hold count mechanism. For example, only modules of type word and server I/O (WSIO) or STREAMS are authorized to use the hold count service of certain UNIX operating systems. Unauthorized modules must be added to a static kernel, requiring a reboot, or must use a means external to the operating system and environment to ensure that processing is complete before the module may be unloaded from kernel memory.